---
title: Load a provider type / all provider types
summary: Loads a single provider type code by value, or the full provider type lookup list.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-21
library: SAIF.Business.View.Provider
reference_type: embedded
operation_id: OP-07
trigger: clsProviderLocation.ProviderType navigation
---

# Load a provider type all provider types

Loads either a single provider type by its code or the full ordered lookup list of provider types, used to resolve and validate `clsProviderLocation.ProviderType`.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-07 |
| **Trigger** | `clsProviderLocation.ProviderType` navigation |
| **Inputs** | `IDataPortalInfo`, provider type code (`String`, optional for the collection) |
| **Outputs** | `clsProviderType`, `clsProviderTypeCollection` |
| **Primary components** | `clsProviderType.GetProviderType`, `clsProviderTypeCollection.GetProviderTypeCollection` |
| **Entry point** | `SAIF.Business.View.Provider/clsProviderType.vb:277`; `SAIF.Business.View.Provider/clsProviderTypeCollection.vb:163` |

## Steps

1. Single-type retrieval binds `:Code` (max length 5) against [PROVIDER_TYPE_CODE](../database-tables.md#provider_type_code) ([SQL-PTYP-01](../sql/SQL-PTYP-01-provider-type-by-code.md)).
2. The collection issues an unparameterised `SELECT ... ORDER BY CODE_DESCR` ([SQL-PTYP-02](../sql/SQL-PTYP-02-all-provider-types.md)) and loads one `clsProviderType` per row.
3. `AfterRetrieve` fills the object(s) and calls `MarkOld()`.
4. Result is consumed by `clsProviderLocation.ProviderType`, whose resolved code is validated by [BR-PLOC-003](../business-rules.md#br-ploc-003-provider-type-code-must-be-non-empty).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Caller request]) --> S1{Single type or full list?}
	S1 -->|Single by code| S2[Bind Code, max length 5]
	S1 -->|Full list| S3[Unparameterised SELECT<br>ORDER BY CODE_DESCR]
	S2 --> S4[AfterRetrieve: Fill, MarkOld]
	S3 --> S4
	S4 --> EndOk(["clsProviderType /<br>clsProviderTypeCollection<br>returned"])
```

## Failure and edge-case behavior

- No matching code: the single-type retrieval returns an object with default field values; [BR-PLOC-003](../business-rules.md#br-ploc-003-provider-type-code-must-be-non-empty) detects an empty resolved code as invalid.
- The full-list query has no filter parameters and always returns the complete code table.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Business.View.Provider/clsProviderType.vb`
- `SAIF.Business.View.Provider/clsProviderTypeCollection.vb`
